package core.dao;

import java.util.List;

public interface BaseDao<T> {
	public abstract T getId(String id);
	public abstract T save(T entity);
	public abstract T saveOrUpdate(T entity);
	public abstract T merge(T entity);
	public abstract void update(T entity);
	public abstract void evict(T entity);
	
	public abstract void delete(T entity);

	public abstract T findByOne(String hql);
	public abstract T findOne(String name, String value);
	public abstract T findOne(String name, int value);
	public abstract T findOne(String name, long value);
	
	public abstract List<T> findList(String name, String value);
	public abstract List<T> findList(String name, int value);
	
	public abstract List<T> findAll();

	public abstract int countModel(String where);
	public abstract int countQuery(String from);
	
	public abstract List<T> findModel(final String where);
	public abstract List<T> findModel(final String where, final int pageSize);
	public abstract List<T> findQuery(final String select,final String from);
	public abstract List<T> findQuery(final String select,final String from, final int pageSize);
	
	public abstract List<T> findSqlQuery(String select, String from, int pageSize);
	public abstract int countSqlQuery(String from);
	public abstract int countFullSqlQuery(String sql);
}
